package com.qys.livesMall.common.enums;

import java.util.Objects;

public enum LanguageEnum {

    ZN_CN("zh_CN","中文"),

    EN_US("en_US","英文"),

    ;
    private String lang;

    private String desc;

    LanguageEnum(String lang,String desc){
        this.lang=lang;
        this.desc=desc;
    }

    public String getLang() {
        return lang;
    }

    public String getDesc() {
        return desc;
    }

    public static LanguageEnum getByLang(String lang){
        for(LanguageEnum languageEnum:LanguageEnum.values()){
            if (Objects.equals(languageEnum.getLang(),lang)){
                return languageEnum;
            }
        }
        return LanguageEnum.EN_US;
    }
}
